package com.xzy.controller;

import com.xzy.dto.UserDto;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 标准表达式
 *
 * <li>变量表达式</li>
 * <li>选择变量表达式</li>
 * <li>链接表达式</li>
 * <li>国际化表达式</li>
 * <li>片段引用表达式</li>
 *
 * @author xzy.xiao
 * @date 2022/7/7  10:08
 */
@Controller
@RequestMapping("/standard_expression")
public class StandardExpressionController {

    /**
     * 变量表达式
     */
    @GetMapping("/variable_expression")
    public String variableExpression(Model model) {
        model.addAttribute("userDto", UserDto.getRandomUser());
        return "/standardExpression/variableExpression";
    }

    /**
     * 选择变量表达式
     */
    @GetMapping("/choose_variable_expression")
    public String chooseVariableExpression(Model model) {
        model.addAttribute("userDto", UserDto.getRandomUser());
        return "/standardExpression/chooseVariableExpression";
    }

    /**
     * 链接表达式
     */
    @GetMapping("link_expression")
    public String linkExpression() {
        return "/standardExpression/linkExpression";
    }

    /**
     * 片段引用表达式
     */
    @GetMapping("/fragment_import")
    public String fragmentImportExpression() {
        return "/standardExpression/fragmentImportExpression";
    }
}
